#ifndef PH_API_WIDGET_ARG__
#define PH_API_WIDGET_ARG__

#include "common.h"
#include <structmember.h>

//=====================================================================
//            Common functions to manipulate resources  
//=====================================================================

/// Resource types to be parsed
typedef enum
{
  eNone,
  eText,
  eColor,
  eTitle,
  eDim
} ResourceType;

#define MAX_ARG_NUM 100
/// Get resource type by it's name
static ResourceType find_resource_type (const char* repr);

/// Initiate array of arguments by python list
static int init_arg (PtArg_t** arg, unsigned* num, PyObject* args, 
    int (*arg_parser)(PtArg_t* arg, PyObject* tuple));

static int access_arg (PtArg_t* arg, PyObject* tuple,
    int (**concrete_arg_table) (PtArg_t* arg, PyObject* tuple));


//=====================================================================
//              Class to get/set Photon resources
//=====================================================================
typedef struct
{
  PyObject_HEAD
  PtArg_t   *arg; ///< Buffer containing PtArg_t structures
  unsigned   num; ///< Number of resources to be set
} WidgetArg;

static void WidgetArg_dealloc (WidgetArg* self);
static PyObject* WidgetArg_new (PyTypeObject* type, PyObject* args);
static int WidgetArg_init (WidgetArg* self, PyObject* args);

#endif

